import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '所属机构',
    align: "center",
    dataIndex: 'belongingDepart_dictText'
  },
  {
    title: '区域类型',
    align: "center",
    dataIndex: 'regionType_dictText'
  },
  {
    title: '生产区域编码',
    align: "center",
    dataIndex: 'number'
  },
  {
    title: '生产区域名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '安全负责人',
    align: "center",
    dataIndex: 'safetyManager_dictText'
  },
  {
    title: '联系方式',
    align: "center",
    dataIndex: 'tel'
  },
  {
    title: '面积',
    align: "center",
    sorter: true,
    dataIndex: 'area'
  },
  {
    title: '有无防护提',
    align: "center",
    dataIndex: 'isMention_dictText'
  },
  {
    title: '防护提面积',
    align: "center",
    dataIndex: 'protectiveLiftingArea'
  },
  {
    title: '储罐个数',
    align: "center",
    sorter: true,
    dataIndex: 'tankNumber'
  },
  {
    title: '罐间最小间距',
    align: "center",
    dataIndex: 'tankMinimumSpacing'
  },
  {
    title: '火灾危险等级',
    align: "center",
    dataIndex: 'fireGrade'
  },
  {
    title: '危险品数量',
    align: "center",
    dataIndex: 'dangerNumber'
  },
  {
    title: '危险品总价值',
    align: "center",
    dataIndex: 'totalValue'
  },
  {
    title: '生产工艺或存储状况简介',
    align: "center",
    dataIndex: 'intro'
  },
  {
    title: '安全措施',
    align: "center",
    dataIndex: 'measure'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'remark'
  },
  {
    title: '经度',
    align: "center",
    dataIndex: 'longitude'
  },
  {
    title: '纬度',
    align: "center",
    dataIndex: 'latitude'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status_dictText'
  },
  {
    title: '上传文件',
    align: "center",
    dataIndex: 'doc',
  },
  {
    title: '租户id',
    align: "center",
    dataIndex: 'tenantId'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "区域类型",
    field: 'regionType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "regionType"
    },
    //colProps: {span: 6},
  },
  {
    label: "生产区域编码",
    field: 'number',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "生产区域名称",
    field: 'name',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "安全负责人",
    field: 'safetyManager',
    component: 'JSelectUser',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '所属机构',
    field: 'belongingDepart',
    component: 'JSelectDept',
  },
  {
    label: '区域类型',
    field: 'regionType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "regionType"
    },
  },
  {
    label: '生产区域编码',
    field: 'number',
    component: 'Input',
  },
  {
    label: '生产区域名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '安全负责人',
    field: 'safetyManager',
    component: 'JSelectUser',
    componentProps:{
      labelKey: 'realname',
    },
  },
  {
    label: '联系方式',
    field: 'tel',
    component: 'Input',
  },
  {
    label: '面积',
    field: 'area',
    component: 'Input',
  },
  {
    label: '有无防护提',
    field: 'isMention',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "haveOrNot"
    },
  },
  {
    label: '防护提面积',
    field: 'protectiveLiftingArea',
    component: 'Input',
  },
  {
    label: '储罐个数',
    field: 'tankNumber',
    component: 'Input',
  },
  {
    label: '罐间最小间距',
    field: 'tankMinimumSpacing',
    component: 'Input',
  },
  {
    label: '火灾危险等级',
    field: 'fireGrade',
    component: 'Input',
  },
  {
    label: '危险品数量',
    field: 'dangerNumber',
    component: 'Input',
  },
  {
    label: '危险品总价值',
    field: 'totalValue',
    component: 'InputNumber',
  },
  {
    label: '生产工艺或存储状况简介',
    field: 'intro',
    component: 'InputTextArea',
  },
  {
    label: '安全措施',
    field: 'measure',
    component: 'InputTextArea',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
  {
    label: '经度',
    field: 'longitude',
    component: 'Input',
  },
  {
    label: '纬度',
    field: 'latitude',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "normalOrStop"
    },
  },
  {
    label: '上传文件',
    field: 'doc',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: '租户id',
    field: 'tenantId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  belongingDepart: {title: '所属机构',order: 0,view: 'sel_depart', type: 'string',},
  regionType: {title: '区域类型',order: 1,view: 'list', type: 'string',dictCode: 'regionType',},
  number: {title: '生产区域编码',order: 2,view: 'text', type: 'string',},
  name: {title: '生产区域名称',order: 3,view: 'text', type: 'string',},
  safetyManager: {title: '安全负责人',order: 4,view: 'sel_user', type: 'string',},
  tel: {title: '联系方式',order: 5,view: 'text', type: 'string',},
  area: {title: '面积',order: 6,view: 'text', type: 'string',},
  isMention: {title: '有无防护提',order: 7,view: 'radio', type: 'string',},
  protectiveLiftingArea: {title: '防护提面积',order: 8,view: 'text', type: 'string',},
  tankNumber: {title: '储罐个数',order: 9,view: 'text', type: 'string',},
  tankMinimumSpacing: {title: '罐间最小间距',order: 10,view: 'text', type: 'string',},
  fireGrade: {title: '火灾危险等级',order: 11,view: 'text', type: 'string',},
  dangerNumber: {title: '危险品数量',order: 12,view: 'text', type: 'string',},
  totalValue: {title: '危险品总价值',order: 13,view: 'number', type: 'number',},
  intro: {title: '生产工艺或存储状况简介',order: 14,view: 'textarea', type: 'string',},
  measure: {title: '安全措施',order: 15,view: 'textarea', type: 'string',},
  remark: {title: '备注',order: 16,view: 'textarea', type: 'string',},
  longitude: {title: '经度',order: 17,view: 'text', type: 'string',},
  latitude: {title: '纬度',order: 18,view: 'text', type: 'string',},
  status: {title: '状态',order: 19,view: 'radio', type: 'string',},
  doc: {title: '上传文件',order: 20,view: 'file', type: 'string',},
  tenantId: {title: '租户id',order: 21,view: 'text', type: 'string',},
};
